Skip to content

Update sal_json.py#8

Open
CodeVigil-bot wants to merge 1 commit into
mainfrom
Code-Review-Bot-Commits-patch-2
Open

Update sal_json.py#8
CodeVigil-bot wants to merge 1 commit into
mainfrom
Code-Review-Bot-Commits-patch-2

Conversation

@CodeVigil-bot

Copy link
Copy Markdown
Owner

No description provided.

Comment thread sal_json.py
Comment on lines +5 to +6
class Emplyee: # Error: Typo in class name
def __init__(self, emp_id, name, position, salary): # Error: Wrong parameter name (emp_id should be employee_id)

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggested comment:
Input: def give_rais(self in 5

Comment thread sal_json.py
Comment on lines +6 to +7
def __init__(self, emp_id, name, position, salary): # Error: Wrong parameter name (emp_id should be employee_id)
self.emp_id = emp_id # Error: Wrong attribute name (self.emp_id should be self.employee_id)

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggested comment: self.employee_id = emp_id in 6

Comment thread sal_json.py
Comment on lines +7 to 8
self.emp_id = emp_id # Error: Wrong attribute name (self.emp_id should be self.employee_id)
self.name = name

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggested comment: self.employee_id = emp_id in 7

Comment thread sal_json.py
Comment on lines +17 to 18
'employee_id': self.emp_id, # Error: Wrong attribute name (self.emp_id should be self.employee_id)
'name': self.name,

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggested comment: 'employee_id': self.employee_ in 17

Comment thread sal_json.py
Comment on lines +32 to +33
employee = Emplyee( # Error: Typo in class name
emp_id=row['employee_id'], # Error: Wrong parameter name (emp_id should be employee_id)

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggested comment: NameError: name 'Emplyee' is in 32

Comment thread sal_json.py
Comment on lines +33 to 34
emp_id=row['employee_id'], # Error: Wrong parameter name (emp_id should be employee_id)
name=row['name'],

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggested comment:
Input: name=row['name'], in 33

Comment thread sal_json.py
Comment on lines +47 to +48
def main(): # Error: Missing indentation for this function
input_file = 'employees.csv' # Error: Incorrect indentation

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggested comment: SyntaxError: expected an indented block
Input in 47

Comment thread sal_json.py
Comment on lines +48 to +49
input_file = 'employees.csv' # Error: Incorrect indentation
output_file = 'employees.json' # Error: Incorrect indentation

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggested comment: IndentationError: expected an indented block in 48

Comment thread sal_json.py
Comment on lines +49 to 50
output_file = 'employees.json' # Error: Incorrect indentation

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggested comment: IndentationError: expected an indented block in 49

Comment thread sal_json.py
Comment on lines +52 to 53
employees = read_employees_from_csv(input_file) # Error: Incorrect indentation
for employee in employees:

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggested comment: employees = read_employees_from_csv in 52

Comment thread sal_json.py
Comment on lines +54 to +55
employee.give_raise(5000) # Error: Incorrect indentation
save_employees_to_json(employees, output_file) # Error: Incorrect indentation

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggested comment: employee.give_raise(500 in 54

Comment thread sal_json.py
Comment on lines +55 to +56
save_employees_to_json(employees, output_file) # Error: Incorrect indentation
print(f"Employee data has been saved to {output_file}") # Error: Incorrect indentation

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggested comment: save_employees_to_json(employees in 55

Comment thread sal_json.py
Comment on lines +56 to 57
print(f"Employee data has been saved to {output_file}") # Error: Incorrect indentation
except Exception as e:

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggested comment: print(f"Employee data has been saved in 56

Comment thread sal_json.py
Comment on lines +58 to 59
print(f"An error occurred: {e}") # Error: Incorrect indentation

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggested comment: An error occurred: {e} # Error in 58

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant